﻿using mscook.core.domain;
using mscook.core.repositories;
using mscook.core.utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mscook.core.services
{
    public class ArticleService : IArticleService
    {
        private IArticleRepository iArticleRepository;
        //private ILogger iLogger;
        public ArticleService(IArticleRepository iArticleRepository)
        {
            this.iArticleRepository = iArticleRepository;
            //this.iLogger = iLogger;
        }

        public IList<Article> SelectAll()
        {
            return iArticleRepository.GetAll();
        }

        public void SaveOrUpdate(Article article)
        {
            iArticleRepository.SaveOrUpdate(article);
        }

        public bool Delete(string id)
        {
            return iArticleRepository.Delete(id);
        }

        public IList<Article> SelectPageList(int start, int limit, out long total)
        {
            return iArticleRepository.SelectPageList(start, limit, out total);
        }

        public Article Get(string id)
        {
            return iArticleRepository.Get(id);
        }
    }
}
